Skip to content

Device apps (portal): every service of an app, each with its ports, opened on its own - #1342

Merged
evanrbowers merged 2 commits into
apps-contract-1from
ac1/app-services
Nov 17, 2026
Merged

evanrbowers merged 2 commits into
apps-contract-1from
ac1/app-services

Conversation

@evanrbowers

Copy link
Copy Markdown
Contributor

Evan's D10 for apps-contract-1, in the portal. An app may now have several services, and a service may have several ports: its listeners' own ports, the first being its launch port. Built against graphql-api #445 (ac1/listeners):

  • DeviceApp.services: [DeviceAppService], primary first. Each has key name protocol multiPort port portSetting listeners { name type port portSetting ports } serviceId ports.
  • DeviceApp.listeners { name listen }.
  • AvailableApp.services.

The single-service fields stay, as the primary's.

The app's page shows each served service:

  • Ports: its name and port, or for a multi-port service its ports as a list. A multi-port service uses the existing multi-port words (multiPort.firstPortOnly, multiPort.subnetReachesAll, as on the Connect page): a connection reaches the first port, the launch port, and the rest by name on the device subnet. That makes a udp or mixed service's other ports address-mode only.
  • Opening: each service has its own Open (Connect for udp, launching nothing) or Open terminal. A multi-port service opens on its first port.
  • Port settings: a setting that is a service's port (portSetting) or one of its listeners' is edited under that service, labelled with it ("Port people connect to", "Port of rtsp", "Port it listens on"). It doesn't appear again under Settings, and shows under Settings while its service is stopped.
  • Host key: shown under the primary.

Nothing assumes one service per app:

  • serviceApp finds the app that names a device's service among any of its services. appServiceOf says which of the app's services it is.
  • Web SSH (opensTerminal, AppTerminal*, ServiceConnectButton) checks that service's own protocol.
  • The device's Apps list offers Open terminal for each ssh service.
  • An offered app gets its declared services from AvailableApp.services.
  • With multi-port services off for the owner, graphql's DeviceApp.detail and its refusals show in its own words, as before.

Gates: npm run typecheck clean; vitest run 217 files, 2151 tests pass; npm run i18n:extract -w=frontend with the catalogs committed (three new keys); npm run i18n:check passes.

Merging waits on graphql-api #445: the query names its fields.

🤖 Generated with Claude Code

…pened on its own

An app may now have several services, and a service several ports (its
listeners' own, the first its launch port). The portal read one service per app
(DeviceApp.serviceId, protocol, portSetting); it now reads DeviceApp.services,
the primary first, and DeviceApp.listeners.

- The app's page shows each served service: its name and port, or a multi-port
  one's ports as a list with the existing multi-port words — a connection
  reaches the first, the rest by name on the device subnet. Each has its own
  Open (Connect for udp, launching nothing) or Open terminal.
- A setting that is a service's port, or one of its listeners', is edited under
  that service, labelled with it ("Port people connect to", "Port of rtsp"),
  and not again under Settings; under Settings while its service is stopped.
- A device's service is its app's when the app names it among its services
  (serviceApp, appServiceOf); web SSH asks the service's own protocol.
- AvailableApp reads services too, so an offered app's primary is known.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@evanrbowers

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T04:51:05.436456Z ae76a23 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45d8f2ca3c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread frontend/src/pages/DeviceAppPage.tsx Outdated
{t('deviceApps.hostKey', 'Host key {{key}}', { key: app.hostKey })}
{shown.map((served, index) => {
const service = device.services?.find(s => s.id === served.serviceId)
const list = served.ports.length ? served.ports : service?.ports ?? []

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refresh multi-port values after editing a listener's setting

When a user changes a multi-port service's listener port using the settings rendered below, the displayed port list and connection instructions retain the old port until the page is reloaded. useDeviceApps.setSetting updates only app.settings, leaving app.services[].ports unchanged, and this expression always prefers that original nonempty list over subsequent updates to device.services. This directs users to the old port even after the setting has been saved and the device has applied it. Refresh the app's service data after saving a port setting, or prefer the updated device service's ports.

Useful? React with 👍 / 👎.

…their ports are graphql's

A change to a service's or a listener's port setting moves the service's ports, which
graphql keeps in step; the page showed the ports it read before until a reload. The
apps are read again after one, and a service's ports are graphql's, else its device
service's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@evanrbowers

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: ae76a23086

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@evanrbowers
evanrbowers merged commit 09fde4b into apps-contract-1 Nov 17, 2026
2 checks passed
@evanrbowers
evanrbowers deleted the ac1/app-services branch November 17, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant